I am currently working on some code that is required to update a number of object attributes as part of a single operation. However, the object state will potentially be inconsistent unless ALL attributes are successfully updated. Therefore, I wish to perform this as a 'transaction' whereby the changes will only be committed if all operations succeed and will be rolled back otherwise. |
Re: UNDO in dxl But you can call the DOORS menu functions with the callStdItem_ (undocumented) function and there is a menu item "undoItem" (documented), so to do in DXL the same action as Edit / Undo (Ctrl-Z) use "callStdItem_ undoItem" - note if no changes are available to undo it returns an error message, so you might want to use noError / lastError around this call. Other way to implement this would be to store per object all the attributes to be changed and their values before the change to a skip list, then try to do the change and if not successful then roll back using the data in the skip list. This might be better, because the above undo method rolls back everything in the undo stack, even though the change might not have come from your script. |
Re: UNDO in dxl Does make continuation of the dxl more problematic if you have a fail. |
Re: UNDO in dxl |
Re: UNDO in dxl These constants seem to be what 'clipLastOp()' returns: int Clear int Undo int Paste int Copy int Cut int clipLastOp() string clipClear() string clipClear(bool) string *clipUndo*() string clipPasteAndUpdateReferences(Folder) string clipPaste(Folder) string clipCopy(Item) string clipCut(Item) void undoMarkUp(Object o) Object markUp(Object o,int firstchar,lastchar) bool undo(History h,Module m) 'Standard Items' avaialable when making menues: redoItem undoItemUndelete undoItemDelete undoItemModify undoItemCut undoItem
|